<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript" src="<%=basePath %>/resource/js/common-css-js.js"></script>
<title>货物清单-添加货物</title>
</head>
<body>
	<div class="panel-body">
		<form class="layui-form">
		  <div class="layui-form-item">
			  <input type="text" name="goodsListProductName" lay-verify="required" placeholder="货物名称" autocomplete="off" class="layui-input">
		  </div>
		  <div class="layui-form-item">
		      <input type="text" name="goodsListProductAmount" lay-verify="required|number" placeholder="货物数量" autocomplete="off" class="layui-input">
		  </div>
		  <div class="layui-form-item">
		      <input type="text" name="goodsListProductUnit" lay-verify="required" placeholder="货物单位" autocomplete="off" class="layui-input">
		  </div>
		  <div class="layui-form-item">
		      <input type="text" name="goodsListUpLimit" lay-verify="required" placeholder="货物充足界限" autocomplete="off" class="layui-input">
		  </div>
		  <div class="layui-form-item">
		      <input type="text" name="goodsListLowLimit" lay-verify="required" placeholder="货物不足界限" autocomplete="off" class="layui-input">
		  </div>
		  <div class="layui-form-item">
		    <select name="goodsListProductClass" lay-verify="required">
		    </select>
      	  </div>
		  <div class="layui-form-item">
		    <select name="goodsListStorageId" lay-verify="required">
		    </select>
      	  </div>
		  <%@include file="/admin/commonsPage/submit-reset.html" %>
		</form>
	</div>
	<script type="text/javascript">
		var stoPos = parent.storagePosition;
		
		if(stoPos.length > 0){
			for (var i = 0;i<stoPos.length;i++){
				$("select[name='goodsListStorageId']").append(
					"<option value="+stoPos[i].stgPosId+">"
					 +stoPos[i].stgPosMark+"("+stoPos[i].stgPosNature +"-"+ stoPos[i].stgPosStatus+")"+
					"</option>"		
				);
			}
		}else {
			fixedAlert("全部货架都已存放满,请去清理货架!",0,true);
		}
		
		renderSelectedOption($("[name='goodsListProductClass']"),parent.productClass);
		
		form.render();
		
		requestAddData("/repository/goods-list");
	</script>
</body>
</html>